﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LigneDuBlancModel;

public partial class accueil : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {


    }
    protected void btn_connect_Click(object sender, EventArgs e)
    {
        using (LigneDuBlancEntities datacontext = new LigneDuBlancEntities())
        {
            Client cli = (from c in datacontext.Client
                          where c.Login == tx_login.Text && c.Pass == tx_pass.Text
                          select c).FirstOrDefault();


            if (cli != null)
            {
                tx_login.Enabled = false;
                tx_pass.Enabled = false;
                btn_connect.Enabled = false;
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, typeof(accueil), "", "alert('erreur de mot de passe');", true);
            }


        }
    }
}